- /**
- * @covers Revision::__construct
- */
- public function testConstructWithText() {
- $rev = new Revision( [
- 'text' => 'hello world.',
- 'content_model' => CONTENT_MODEL_JAVASCRIPT
- ] );
-
- $this->assertNotNull( $rev->getContent(), 'no content object available' );
- $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, $rev->getContent()->getModel() );
- $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, $rev->getContentModel() );
- }
-
- /**
- * @covers Revision::__construct
- */
- public function testConstructWithContent() {
- $title = Title::newFromText( 'RevisionTest_testConstructWithContent' );
-
- $rev = new Revision( [
- 'content' => ContentHandler::makeContent( 'hello world.', $title, CONTENT_MODEL_JAVASCRIPT ),
- ] );
-
- $this->assertNotNull( $rev->getContent(), 'no content object available' );
- $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, $rev->getContent()->getModel() );
- $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, $rev->getContentModel() );
- }
-